package com.jk.controller;

import com.jk.dto.Tree;
import com.jk.interfaces.DepartmentServiceApi;
import com.jk.pojo.ResponseResult;
import com.jk.service.DepartmentServiceFeign;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author yzf
 * @version 1.0
 * @ClassName DepartmentController
 * @program: office
 * @description: TODO
 * @date 2025/2/13 20:23
 */
@Api(tags = "部门树")
@Slf4j
@RestController
@RequestMapping("/tree")
public class DepartmentController {
    @Autowired
    private DepartmentServiceFeign departmentServiceFeign;

    @ApiOperation(value = "查询部门树",httpMethod = "POST",notes = "")
    @PostMapping("findDepartmentTree")
    public ResponseResult<List<Tree>> findDepartmentTree(@RequestBody Tree tree){
        return new ResponseResult<>(200,"查询部门树成功",departmentServiceFeign.findDepartmentTree(tree));
    }

}
